home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_4015.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  126 lines

  1. -- card: 4015 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3837
  5. -- name: FileName
  6. ----- HyperTalk script -----
  7. on closecard
  8.   hide message window
  9. end closecard
  10.  
  11.  
  12.  
  13. -- part 10 (button)
  14. -- low flags: 00
  15. -- high flags: A004
  16. -- rect: left=223 top=245 right=293 bottom=283
  17. -- title width / last selected line: 0
  18. -- icon id / first selected line: 27056 / 27056
  19. -- text alignment: 1
  20. -- font id: 0
  21. -- text size: 12
  22. -- style flags: 0
  23. -- line height: 16
  24. -- part name: Try it
  25. ----- HyperTalk script -----
  26. on mouseUp
  27.   put "Just select a file & it will return the full pathname"
  28.   put filename()
  29. end mouseUp
  30.  
  31.  
  32.  
  33. -- part 11 (button)
  34. -- low flags: 00
  35. -- high flags: A003
  36. -- rect: left=82 top=302 right=324 bottom=182
  37. -- title width / last selected line: 0
  38. -- icon id / first selected line: 0 / 0
  39. -- text alignment: 1
  40. -- font id: 0
  41. -- text size: 12
  42. -- style flags: 0
  43. -- line height: 16
  44. -- part name: Install
  45. ----- HyperTalk script -----
  46. on mouseUp
  47.   if the optionkey is down then
  48.     pass mouseup
  49.   end if
  50.  
  51.   put (long name of this stack) into sourceStack
  52.   delete first word of sourceStack
  53.   delete first character of sourceStack
  54.   delete last character of sourceStack
  55.   put "Select a stack to copy this resource into."
  56.   put filename("STAK") into fname
  57.   if fname is empty then
  58.     hide message window
  59.     exit mouseup
  60.   end if
  61.   if sourcestack=fname then
  62.     beep
  63.     Answer "Get real.  You can't install it in this stack"
  64.     hide message window
  65.     exit mouseup
  66.   end if
  67.  
  68.   --
  69.   ModResCopy sourceStack,fname,"XFCN","FileName"
  70.   --
  71.   get the result
  72.   if first char of it is "E" then
  73.     put it into the message box
  74.     beep
  75.     answer "Attempt to install resource has failed."
  76.   else
  77.     beep
  78.     answer "Resource installation successful"
  79.   end if
  80.   hide message window
  81. end mouseUp
  82.  
  83.  
  84.  
  85. -- part contents for background part 6
  86. ----- text -----
  87.  
  88. This allows your HyperTalk scripts to request a filename via a Standard File Package dialog box.
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97. Thanks to:
  98. Steve Maller, Apple Computer.
  99. AppleLink: maller1 ‚Ä¢ Delphi: stevemaller ‚Ä¢ MCI Mail: smaller
  100.  
  101.  
  102. -- part contents for background part 5
  103. ----- text -----
  104. FileName
  105.  
  106. -- part contents for background part 10
  107. ----- text -----
  108. 1
  109.  
  110. -- part contents for background part 7
  111. ----- text -----
  112. Syntax:
  113.  
  114. FileName()
  115. shows all files, or
  116.  
  117. FileName("TYPE")
  118. where "TYPE" is the type of the file you want to open.
  119.  
  120. For example:
  121. FileName("APPL") will show only applications
  122.  
  123. FileName("STAK") will show only stacks.
  124.  
  125. FileName("TEXT") will show only text documents.
  126.